







//
//  MBDetailTableview.m
//  房源、商铺、写字楼详情页
//
//  Created by MB__Lee on 2018/5/22.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "MBDetailTableview.h"

#import "MBNetTool.h"

@interface MBDetailTableview()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,copy)NSString *sn;

@property(nonatomic,strong)MBFangDetailModel *model;
@property(nonatomic,strong)NSMutableArray *sourceMut; //用于存放每行

@end

@implementation MBDetailTableview
-(NSMutableArray *)sourceMut{
    if (!_sourceMut) {
        _sourceMut = [NSMutableArray array];
    }
    return  _sourceMut;
}

-(instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style sn:(NSString *)sn{
    if (self  = [super initWithFrame:frame style:style]) {
        self.sn = sn;
        self.delegate = self;
        self.dataSource =  self;
        
    }
    return  self;
}

-(void)getModelFromServe{
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    dic[@"sn"] = self.sn;
    [MBNetTool MBPost:Fang_info paramater:dic success:^(id response) {
        if ([response[@"code"] integerValue] == 10000) {
            MBFangDetailModel *model  = [[MBFangDetailModel alloc] initWithDictionary:response[@"data"] error:nil];
            _model = model;
            [self prosecingModel:model];
        }
        
    } failure:^(NSError *error) {
        
    }];
    
}
-(void)prosecingModel:(MBFangDetailModel *)model{
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return  self.sourceMut.count;
}



@end
